"""
分析
1 石头  2 剪刀   3 布
pc   随机范围 1-3
player
pc赢
1、电脑出石头，玩家出剪刀
2、电脑出布 玩家出石头
3、电脑出剪刀 玩家出布
平局
电脑 和玩家出的都一样
剩下的都是玩家赢
"""
import random

# pc随机出拳
pc = random.randint(1, 3)
# 玩家
player = input("玩家出拳：")
# isdigit() 只针对字符串 判断字符串是否是全数字
# 如果是全数字返回true 不是数字返回false
# len() 字符串长度
if player.isdigit() and (int(player) >= 1 and int(player) <= 3):
    player = int(player)
    if ((pc == 1 and player == 2) or
            (pc == 2 and player == 3) or
            (pc == 3 and player == 1)):
        print("电脑赢")
    elif pc == player:
        print("平局")
    else:
        print("玩家赢")
else:
    print("你出拳有误，请输入1,2,3")

# if     pc == 1 and player == 2:
#     print("电脑赢")
# elif pc==2 and player==3:
#     print("电脑赢")
